<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="../include/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>字段模板表单页面</title>
<%@ include file="../include/easyui.jsp"%>
</head>
<body>
<div>
	<form id="mainform" action="${ctx}/import/detailExcelTemplate/${action}" method="post">
	<table  class="formTable">
		<tr>
			<c:if test="${action == 'update'}">
				<input type="hidden" name="id" value="${id }" />
			</c:if>
			<td>主模板：</td>
			<td><input type="text" id="mainTemplateId" name="mainTemplateId" value="${detailExcelTemplate.mainTemplateId}" class="easyui-numberbox"  data-options="width: 150,required:'required'"/></td>
		</tr>
		<tr>
			<td>字段名称：</td>
			<td><input id="fieldName" name="fieldName" type="text" value="${detailExcelTemplate.fieldName }" class="easyui-validatebox"  data-options="width: 150,required:'required'"/></td>
		</tr>
		<tr>
			<td>字段类型：</td>
			<td>
				<select id="fieldType" name="fieldType"  class="easyui-combobox" data-options="width:140,height:29,editable:false,panelHeight:'auto'">
					<option value="0" <c:if test="${detailExcelTemplate.fieldType == '0'}">selected</c:if>>整形</option>
					<option value="1" <c:if test="${detailExcelTemplate.fieldType == '1'}">selected</c:if>>浮点型</option>
					<option value="2" <c:if test="${detailExcelTemplate.fieldType == '2'}">selected</c:if>>字符型</option>
					<option value="3" <c:if test="${detailExcelTemplate.fieldType == '3'}">selected</c:if>>布尔型</option>
				</select>
			</td>
		</tr>
		<tr>
			<td>字段列数：</td>
			<td><input id="columnNum" name="columnNum" type="text" value="${detailExcelTemplate.columnNum}" class="easyui-numberbox" data-options="width: 150,required:'required'" /></td>
		</tr>
		<tr>
			<td>排序：</td>
			<td><input id="sort" name="sort" type="text" value="${detailExcelTemplate.sort}" class="easyui-numberbox" data-options="width: 150" /></td>
		</tr>
		<tr>
			<td>是否导入：</td>
			<td>
				<select id="effective" name="effective"  class="easyui-combobox" data-options="width:140,height:29,editable:false,panelHeight:'auto'">
					<option value="0" <c:if test="${detailExcelTemplate.effective == false}">selected</c:if>>导入</option>
					<option value="1" <c:if test="${detailExcelTemplate.effective == true}">selected</c:if>>不导入</option>
				</select>
			</td>
		</tr>
		<tr>
			<td>是否为空：</td>
			<td>
				<select id="nullable" name="nullable"  class="easyui-combobox" data-options="width:140,height:29,editable:false,panelHeight:'auto'">
					<option value="0" <c:if test="${detailExcelTemplate.nullable == false}">selected</c:if>>可为空</option>
					<option value="1" <c:if test="${detailExcelTemplate.nullable == true}">selected</c:if>>不可为空</option>
				</select>
			</td>
		</tr>
	</table>
	</form>
</div>

<script type="text/javascript">
var action="${action}";
//主模板
$('#mainTemplateId').combotree({
	width:150,
	method:'GET',
	url: '${ctx}/import/mainExcelTemplate/lists',
	idField : 'id',
	textFiled : 'name',
	iconCls: 'icon',
	animate:true
});
$(function(){
	$('#mainform').form({    
	    onSubmit: function(){    
	    	//var isValid = $(this).form('validate');
			//return isValid;	// 返回false终止表单提交
	    },    
	    success:function(data){
			var data = eval('(' + data + ')');
	    	successTip(data.message,dg,dialog);
	    }    
	}); 
});
</script>

</body>
</html>